class Document < ActiveRecord::Base

  belongs_to :project

  validates_presence_of :name
  
  def doc_file=(data_field)
    self.filename=data_field.original_filename;
    self.content_type=data_field.content_type.chomp;
    self.data=data_field.read();
  end
  
  def self.all_documents
    Document.find(:all)
  end
end
